if ( isset( $options['bypassCache'] ) ) {
$options['latest'] = $options['bypassCache']; // b/c
}
+ $options += [ 'time' => false ];
if ( !$this->reposInitialised ) {
$this->initialiseRepos();
}
+
$title = File::normalizeTitle( $title );
if ( !$title ) {
return false;
# Check the cache
$dbkey = $title->getDBkey();
+ $timeKey = is_string( $options['time'] ) ? $options['time'] : '';
if ( empty( $options['ignoreRedirect'] )
&& empty( $options['private'] )
&& empty( $options['latest'] )
) {
- $time = $options['time'] ?? '';
- if ( $this->cache->hasField( $dbkey, $time, 60 ) ) {
- return $this->cache->getField( $dbkey, $time );
+ if ( $this->cache->hasField( $dbkey, $timeKey, 60 ) ) {
+ return $this->cache->getField( $dbkey, $timeKey );
}
$useCache = true;
} else {
- $time = false;
$useCache = false;
}
$image = $image ?: false; // type sanity
# Cache file existence or non-existence
if ( $useCache && ( !$image || $image->isCacheable() ) ) {
- $this->cache->setField( $dbkey, $time, $image );
+ $this->cache->setField( $dbkey, $timeKey, $image );
}
return $image;